package com.qf.service.Impl;

import com.qf.entity.Stu;
import com.qf.entity.Stusub;
import com.qf.entity.Subject;
import com.qf.mapper.StuMapper;
import com.qf.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * --- 年少有为 ---
 *
 * @author ChenZhuo
 * @date 2025/8/12
 * @desc
 */
@Service
public class StuServiceImpl implements StuService {
    @Autowired
    private StuMapper stuMapper;
    @Override
    public Stu findById(int id) {
        Stu stu = stuMapper.findById(id);
        return stu;
    }

    @Override
    public List<Stu> findAll() {

        return stuMapper.findAll();
    }

    @Override
    public List<Stu> findByLike(HashMap<String, String> map) {

        return stuMapper.findByLike(map);
    }

    @Override
    public boolean addStu(Stu stu) {
        return stuMapper.addStu(stu);
    }

    @Override
    public boolean updateStu(Stu stu) {
        return stuMapper.updateStu(stu);
    }

    @Override
    public boolean deleteStu(int id) {
        return stuMapper.deleteStu(id);
    }

    @Override
    public boolean deleteSomeStu(List<Integer> id) {
        return stuMapper.deleteSomeStu(id);
    }

    @Override
    public boolean addSomeStu(List<Stu> stus) {
        return stuMapper.addSomeStu(stus);
    }

    @Override
    public ArrayList<Stusub> findStuSub(Integer id) {
        return stuMapper.findStuSub(id);
    }

    @Override
    public Subject findSubjectBySubId(Integer subId) {
        return stuMapper.findSubjectBySubId(subId);
    }
}
